﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
	xmlns:Extensions="clr-namespace:WinChrome.Extensions" 
    xmlns:Convertors="clr-namespace:WinChrome.Convertors"
    xmlns:UI="clr-namespace:WinChrome.UI"
    >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/WinChrome;component/UI/HistoryNavigatorStyles/BaseResourceDictionary.xaml" />
    </ResourceDictionary.MergedDictionaries>

 
    <!--Style-->
    <Style TargetType="Button" x:Key="BackwardsArrowButton">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Command" Value="NavigationCommands.BrowseBack"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="MinWidth" Value="24"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Ellipse x:Name="Border"
                            Width="20" Height="20"
                            Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" 
                            Fill="White" />
                        <Path x:Name="Arrow"      
                              Data="M 0.25,0.475
                                    L 0.25, 0.525
                                    L 0.45,0.75 L 0.575,0.75
                                    L 0.425,0.565 0.75,0.565
                                    L 0.75,0.435 L 0.425,0.435
                                    L 0.575,0.25 0.45,0.25
                                    L 0.25,0.475"
                  Width="10" Height="10" Stretch="Uniform" 
    	        Fill="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Fill" Value="White" />
                        </Trigger>
                        <Trigger Property="Command" Value="{x:Static NavigationCommands.BrowseForward}">
                            <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Stroke" Value="White" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Stroke" Value="White" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="Transparent" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="Button" x:Key="ForwardsArrowButton">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="MinWidth" Value="24"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <Ellipse x:Name="Border"
                            Width="20" Height="20" 
                            Stroke="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" 
                            Fill="White"/>
                        <Path x:Name="Arrow" 
                            Data="M 0.75,0.475
                                    L 0.75, 0.525
                                    L 0.55,0.75 L 0.425,0.75
                                    L 0.575,0.565 0.25,0.565
                                    L 0.25,0.435 L 0.575,0.435
                                    L 0.425,0.25 0.55,0.25
                                    L 0.75,0.475"                   
                            Width="10" Height="10" Stretch="UniformToFill" Canvas.Top="8" Canvas.Left="8"
    	                    Fill="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Fill" Value="White" />
                        </Trigger>
                        <Trigger Property="Command" Value="{x:Static NavigationCommands.BrowseForward}">
                            <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Stroke" Value="White" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Stroke" Value="White" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Fill" Value="Transparent" />
                            <Setter TargetName="Border" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" />
                            <Setter TargetName="Arrow" Property="Stroke" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

 
    <Style x:Key="DropArrow" TargetType="ToggleButton">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="MinHeight" Value="24"/>
        <Setter Property="MinWidth" Value="16"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid >
                        <Path x:Name="DropArrow" 
                                Data="M0.5,0 L0,0 0.5,1 1,0 Z" 
	                    Margin="4.5,10"
	                    Stretch="Fill" Fill="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="DropArrow" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="DropArrow" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
                        </Trigger>
                        <!--<MultiTrigger>-->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="DropArrow" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="DropArrow" Property="Fill" Value="{DynamicResource {x:Static SystemColors.HotTrackBrushKey}}"/>
                        </Trigger>
                        <!--</MultiTrigger>-->
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="HistoryNavigatorVS2012" TargetType="UI:HistoryNavigator">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Canvas SnapsToDevicePixels="False">
                        <Button x:Name="PART_BackButton" Canvas.Left="2" Canvas.Top="3" Style="{StaticResource BackwardsArrowButton}" />
                        <Button x:Name="PART_ForwardButton" Canvas.Left="32" Canvas.Top="3" Style="{StaticResource ForwardsArrowButton}" />
                        <ToggleButton x:Name="PART_DropButton" Canvas.Left="60" Canvas.Top="3" Style="{StaticResource DropArrow}"  >
                            <!--Click="PART_DropButton_Click"-->
                            <ToggleButton.ContextMenu>
                                <ContextMenu x:Name="PART_ContextMenu"    
                                     ItemTemplate="{StaticResource journalMenuItemTemplate}" 
                                    ItemContainerStyle="{StaticResource journalMenuItemContainerStyle}" >
                                </ContextMenu>
                            </ToggleButton.ContextMenu>
                        </ToggleButton>
                    </Canvas>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>